package com.lechuang.controller.validate.mobile.login;

import com.lechuang.controller.BaseController;
import com.lechuang.controller.validate.BaseValidator;
import com.lechuang.model.User;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Administrator on 2016/9/28.
 */
public class LoginValidate extends BaseValidator{

    @Override
    public void validate(HttpServletRequest request) {
        super.validate(request);
        validateRequireString("phone",errorMsg,"请输入电话号码");
        validateRequireString("password",errorMsg,"请输入密码");
        validateRequireString("password2",errorMsg,"请再次输入密码");
        validateRequireString("code",errorMsg,"请输入验证码");
        String password = getParaToString("password");
        String password2 = getParaToString("password2");
        if(!password.equals(password2)){
            addError(errorMsg,"两次密码不一致");
        }

    }
}
